using System.Data.Entity.Migrations;
using WpfApplication6.Model;

namespace WpfApplication6.Migrations
{
    internal sealed class Configuration : DbMigrationsConfiguration<NorthwindDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
            AutomaticMigrationDataLossAllowed = true;
        }

        protected override void Seed(NorthwindDbContext context)
        {
            context.Products.AddOrUpdate(
                p => p.Id,
                new ProductItem {Id = 1, Name = "Samsung Galaxy Ace", CategoryName = "Smartphone" },
                new ProductItem {Id = 2, Name = "Samsung Galaxy S3", CategoryName = "Smartphone"},
                new ProductItem {Id = 3, Name = "HP Pavillion", CategoryName = "Netbook"},
                new ProductItem {Id = 4, Name = "Toshiba Satellite", CategoryName = "Laptop"}
                );
        }
    }
}